package com.stlm2.dems.entity.base;

import com.stlm2.dems.entity.*;

import java.math.BigDecimal;
import java.util.Date;

/**
 * Author：fuchunyu
 * Date：2017/12/20
 * Description：商品兑换订单表
 */
public class BaseIntegralOrder {

    private Integer id;//商品标识
    private Integer userId;//下单用户
    private String code;//订单编号
    private BigDecimal payIntegral;//支付积分
    private Date createTime;//创建时间
    private String city;//所在城市
    private String addressDetail;//详细地址
    private String name;//收货人
    private String phone;//联系电话
    private OrderState orderState;//订单状态
    private Date cancelTime;//取消时间
    private PayChannel payChannel;//支付方式
    private DeliveryType deliveryType;//发货方式
    private CancelReason cancelReason;//取消原因
    private String memo;//订单备注
    private Integer goodsId;//关联商品
    private Integer num;//商品个数
    private BigDecimal unitIntegral;//商品单价
    private ExpressType expressType;//物流公司
    private String wayBillNum;//物流单号
    private Date receiptEndTime;//收货时间
    private Date payTime;//支付时间
    private Integer periodsId;//期号ID
    private Date openTime;//开奖时间
    private GoodsType goodsType;//商品类型
    private Boolean prizeState;

    public Integer getPeriodsId() {
        return periodsId;
    }

    public void setPeriodsId(Integer periodsId) {
        this.periodsId = periodsId;
    }

    public Date getOpenTime() {
        return openTime;
    }

    public void setOpenTime(Date openTime) {
        this.openTime = openTime;
    }

    public GoodsType getGoodsType() {
        return goodsType;
    }

    public void setGoodsType(GoodsType goodsType) {
        this.goodsType = goodsType;
    }

    public Boolean getPrizeState() {
        return prizeState;
    }

    public void setPrizeState(Boolean prizeState) {
        this.prizeState = prizeState;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public BigDecimal getPayIntegral() {
        return payIntegral;
    }

    public void setPayIntegral(BigDecimal payIntegral) {
        this.payIntegral = payIntegral;
    }

    public Integer getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public BigDecimal getUnitIntegral() {
        return unitIntegral;
    }

    public void setUnitIntegral(BigDecimal unitIntegral) {
        this.unitIntegral = unitIntegral;
    }

    public ExpressType getExpressType() {
        return expressType;
    }

    public void setExpressType(ExpressType expressType) {
        this.expressType = expressType;
    }

    public String getWayBillNum() {
        return wayBillNum;
    }

    public void setWayBillNum(String wayBillNum) {
        this.wayBillNum = wayBillNum;
    }

    public Date getReceiptEndTime() {
        return receiptEndTime;
    }

    public void setReceiptEndTime(Date receiptEndTime) {
        this.receiptEndTime = receiptEndTime;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getAddressDetail() {
        return addressDetail;
    }

    public void setAddressDetail(String addressDetail) {
        this.addressDetail = addressDetail;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public OrderState getOrderState() {
        return orderState;
    }

    public void setOrderState(OrderState orderState) {
        this.orderState = orderState;
    }

    public Date getCancelTime() {
        return cancelTime;
    }

    public void setCancelTime(Date cancelTime) {
        this.cancelTime = cancelTime;
    }


    public PayChannel getPayChannel() {
        return payChannel;
    }

    public void setPayChannel(PayChannel payChannel) {
        this.payChannel = payChannel;
    }


    public DeliveryType getDeliveryType() {
        return deliveryType;
    }

    public void setDeliveryType(DeliveryType deliveryType) {
        this.deliveryType = deliveryType;
    }

    public CancelReason getCancelReason() {
        return cancelReason;
    }

    public void setCancelReason(CancelReason cancelReason) {
        this.cancelReason = cancelReason;
    }



    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }


    /**
     * 支付渠道
     * @return
     */
    public Integer getPayChannelValue(){
        return (payChannel != null) ? payChannel.getIntValue() : null;
    }

    public void setPayChannelValue(Integer v){
        if(v != null)
            payChannel = PayChannel.getByIntValue(v);
    }

    /**
     * 订单状态
     * @return
     */
    public Integer getOrderStateValue(){
        return (orderState != null) ? orderState.getIntValue() : null;
    }

    public void setOrderStateValue(Integer v){
        if(v != null)
            orderState = OrderState.getByIntValue(v);
    }

    /**
     * 配送方式
     * @return
     */
    public Integer getDeliveryTypeValue(){
        return (deliveryType != null) ? deliveryType.getIntValue() : null;
    }

    public void setDeliveryTypeValue(Integer v){
        if(v != null)
            deliveryType = DeliveryType.getByIntValue(v);
    }
    /*
    * 取消原因
    * */
    public void setCancelReasonValue(Integer cancelReasonValue){

        if( cancelReasonValue != null)
            cancelReason = CancelReason.getByIntValue(cancelReasonValue);
    }
    public Integer getCancelReasonValue(){
        return  (cancelReason!=null)? cancelReason.getIntValue() : null;
    }

    /**
     * 快递公司
     * @return
     */
    public Integer getExpressTypeValue(){
        return (expressType != null) ? expressType.getIntValue() : null;
    }

    public void setExpressTypeValue(Integer v){
        if(v != null)
            expressType = ExpressType.getByIntValue(v);
    }

    /**
     * 商品状态
     * @return
     */
    public Integer getGoodsTypeValue(){return (goodsType != null) ? goodsType.getIntValue() : null;}
    public void setGoodsTypeValue(Integer n){
        if(n != null)
            goodsType = GoodsType.getByIntValue(n);
    }
}
